package com.shop.om.sysUser.dao;

import com.jt.common.cache.JtCacheable;
import com.jt.common.cache.JtCacheableEvict;
import com.shop.om.mapper.BaseMapper;
import com.shop.om.model.sysUser.MlsUserEntity2;
import com.shop.om.model.sysUser.SysUserEntity;
import com.shop.om.model.sysUser.UserWindowDto;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

/**
 * @author cjt
 * @version 1.0.0
 * @description 系统用户
 * @date 2020/6/19  14:08
 * @Version v1.0
 **/
@Mapper
public interface SysUserDao extends BaseMapper<SysUserEntity> {
    /**
     * 查询用户的所有权限
     *
     * @param userId 用户ID
     */
    List<String> queryAllPerms(Long userId);
    /**
     * 查询用户的所有菜单ID
     */
    List<Long> queryAllMenuId(Long userId);

    /**
     * 根据用户名，查询系统用户
     */
    @JtCacheable
    SysUserEntity queryByUserName(String username);

    /**
     * 修改密码
     */
    @JtCacheableEvict
    int updatePassword(Map<String, Object> map);
    /**
     * 根据实体类查询
     * @param userWindowDto
     * @return
     */
    List<UserWindowDto> queryListByBean(UserWindowDto userWindowDto);
    /**
     *更新商户ID
     */
    int updateMerchantId(SysUserEntity t);

    int mlsUseCount(String tel);
    void insertMlsUse(MlsUserEntity2 t);
    void updateMlsUse(MlsUserEntity2 t);
}
